<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,initial-scale=1.0,width=device-width" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>扫描二维码</title>
    <link rel="stylesheet" href="../../css/api.css" />
    <link rel="stylesheet" href="../../css/common.css" />
</head>

<body>
    <header class="yt-header">
        <h1 class="yt-header-title">二维码扫描</h1>
    </header>
    <section class="content">
        <button class="button block" onclick="openScanner()">打开扫一扫</button>
        <div class="resault">

        </div>
    </section>
</body>
<script src="../../script/api.js"></script>
<script>
    apiready = function() {

    }

    function initPage() {

    }

    function openScanner() {
        var scanner = api.require("FNScanner")
        scanner.open({}, function(ret) {
            var resaultDom = $api.dom('.resault')
            $api.html(resaultDom, JSON.stringify(ret))
        })
    }
</script>

</html>
